﻿using LdCommunication;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Sockets;
using System.Text;
using System.Threading.Tasks;

namespace LD.Host.SECS
{
    public  class NewworkBase
    {
        public OperateResult<Socket> CreateSocketAndConnect(IPEndPoint endPoint, int timeOut)
        {
            int num = 0;
            while (true)
            {
                Socket socket=new Socket(endPoint.AddressFamily,SocketType.Stream, ProtocolType.Tcp);
                try
                {
                    socket.Connect(endPoint);
                }
                catch (Exception)
                {
                    socket?.Close();
                    throw;
                }
            }
        }
    }
}
